<%--
  Created by IntelliJ IDEA.
  User: KAlways18
  Date: 2021/12/8
  Time: 16:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>学生修改</title>
    <%@include file="/link/link-head.jsp" %>
</head>
<body>
<form action="${pageContext.request.contextPath}/student/update" method="post">
    <input type="hidden" value="${requestScope.pageNum}" name="pageNum">
    <table>
        <tr>
            <td>编号</td>
            <td>
                <input type="text" readonly="readonly" name="sId" value="${requestScope.student.sId}">
            </td>
        </tr>
        <tr>
            <td>生日</td>
            <td>
                <input type="date" name="sBirthday"
                       value="<fmt:formatDate value="${requestScope.student.sBirthday}" pattern="yyyy-MM-dd"/>">
            </td>
        </tr>
        <tr>
            <td>党员</td>
            <td>
                <c:if test="${requestScope.student.sDy ==1}">
                    <select name="sDy">
                        <option value="0" selected="selected">不是</option>
                        <option value="1">是</option>
                    </select>
                </c:if>
                <c:if test="${requestScope.student.sDy ==0}">
                    <select name="sDy">
                        <option value="0">不是</option>
                        <option value="1" selected="selected">是</option>
                    </select>
                </c:if>
            </td>
        </tr>
        <tr>
            <td>性别</td>
            <td>
                <c:if test="${requestScope.student.sGender=='男'}">
                    <input type="radio" name="sGender" value="男" checked="checked">男 &nbsp;&nbsp;
                    <input type="radio" name="sGender" value="女">女
                </c:if>
                <c:if test="${requestScope.student.sGender!='男'}">
                    <input type="radio" name="sGender" value="男">男 &nbsp;&nbsp;
                    <input type="radio" name="sGender" value="女" checked="checked">女
                </c:if>
            </td>
        </tr>
        <tr>
            <td>姓名</td>
            <td>
                <input type="text" name="sName" value="${requestScope.student.sName}">
            </td>
        </tr>
        <tr>
            <td>成绩</td>
            <td><input type="text" name="sScore" value="${requestScope.student.sScore}"></td>
        </tr>
    </table>
    <input type="submit" value="修改">
    <input type="button" onclick="rowback()" value="退回上一步">
</form>
</body>
<script>
    function rowback() {
        window.history.back(-1);
    }
</script>
</html>
